package com.foxchen.decrypt.utils;

import cn.hutool.crypto.symmetric.AES;

public class AesUtil {

    private static final AES AES_INSTANCE;
    static {
        AES_INSTANCE = new AES("CBC", "PKCS7Padding",
                // 密钥，可以自定义
                "Chenjin1314.....".getBytes(),
                // iv加盐，按照实际需求添加
                "tian2577229883..".getBytes());
    }

    public static String encryptAes(String content){
        // 加密为16进制表示
        return AES_INSTANCE.encryptHex(content).toUpperCase();
    }

    public static String decryptAes(String encryptAes){
        // 加密为16进制表示
        return AES_INSTANCE.decryptStr(encryptAes.toLowerCase());
    }
}
